<?php
class NewsClassController extends AdminBaseController  {
	public function lists(){
		$data['list'] = HttpServerManager::getNewsClassServer()->infiniteClass(array('id'=>0));
		return $data;
	}
	public function add(){
		if (!empty($_GET['id'])){
			$data = HttpDaoManager::getNewsClassDao()->get($_GET['id']);
		}
		$data['newsClass'] =  HttpServerManager::getNewsClassServer()->infiniteClass(array('id'=>0));	
		$data['id'] = isset($data['id'])?$data['id']: Common::getGetStrValue('id');
		return $data;
	}
	public function subAdd(){
		HttpDaoManager::getNewsClassDao()->add($_POST);
		ClassManager::getToos()->msgbox("添加成功");
	}
	public function subUpdate(){
		HttpDaoManager::getNewsClassDao()->update($_POST,$_POST['id']);
		ClassManager::getToos()->msgbox("修改成功",'NewsClass_lists.html');
	}
	public function delete(){
		HttpServerManager::getNewsClassServer()->deleteBatchByid($_GET['id']);
		ClassManager::getToos()->msgbox("删除成功");
	}
}
?>